//
// Source code recreated from a .class file by IntelliJ IDEA
// (powered by Fernflower decompiler)
//

package com.stylefeng.guns.modular.utity;

import com.stylefeng.guns.modular.base.ApiResultBean;

public final class ApiResultFactory {
    private ApiResultFactory() {
    }

    public static ApiResultBean toSuccess(String msg) {
        return toSuccess(msg, (Object)null);
    }

    public static ApiResultBean toSuccess(String msg, Object data) {
        ApiResultBean dto = new ApiResultBean();
        dto.setSuccess(true);
        dto.setMessage(msg);
        dto.setData(data);
        return dto;
    }

    public static ApiResultBean toError(String msg, int code) {
        return toError(msg, code, (Object)null);
    }

    public static ApiResultBean toError(String msg, int code, Object data) {
        ApiResultBean bean = new ApiResultBean();
        bean.setSuccess(false);
        bean.setMessage(msg);
        bean.setData(data);
        bean.setCode(code);
        return bean;
    }
}
